from pydantic import BaseModel, Field
from typing import Optional, Generic, TypeVar

# 定义泛型类型变量
T = TypeVar('T')

class ResponseModel(BaseModel, Generic[T]):
    """统一响应模型"""
    code: int = Field(description="状态码")
    msg: str = Field(description="提示信息")
    data: Optional[T] = Field(default=None, description="响应数据") 
    execute_success_num: Optional[int] = Field(default=None, description="执行成功次数")
